{% extends "learning/base.html" %}

{% block title %}编辑公告 · 高中数学助手{% endblock %}

{% block content %}
<section class="card" style="max-width:720px;margin:2rem auto;padding:2.5rem;display:grid;gap:1rem;">
    <h2 style="margin:0;">编辑公告</h2>
    <form method="post">
        {% csrf_token %}
        {% for field in form %}
            <label for="{{ field.id_for_label }}">{{ field.label }}</label>
            {{ field }}
            {% if field.help_text %}
                <small style="display:block;color:var(--text-secondary);margin-top:0.3rem;">{{ field.help_text }}</small>
            {% endif %}
            {% for error in field.errors %}
                <small style="color:var(--danger);display:block;margin-top:0.3rem;">{{ error }}</small>
            {% endfor %}
        {% endfor %}
        <div style="display:flex;gap:0.8rem;margin-top:1rem;">
            <button class="button" type="submit">保存修改</button>
            <a class="button secondary" href="{% url 'accounts:profile' %}">返回教师工作台</a>
        </div>
    </form>
</section>
{% endblock %}
